/*
 * Panel.fx
 * Author: Yu Min-ting
 * Created on 2009-7-9, 13:25:42
 */

package com.sjtu.fx.tools;

import javafx.scene.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
import javafx.scene.effect.*;
import javafx.stage.*;

import javafx.scene.text.*;

//Panel which can be used in all page components.
public class Panel extends CustomNode {
     public var width = 400;
     public var height = 380;
     public var title = "Members Login";

    override protected function create() : Node {
        Group{
            content:[
                Rectangle{
                    width:width height:height
                    arcWidth: 10  arcHeight: 10
                    x:0 y:0
                    fill:Color.rgb(200,225,230)
                    effect:{
                        GaussianBlur { radius: 63  }
                        DropShadow{offsetX:3 offsetY:3 radius:10 color: Color.GRAY}
                    }
                },
                 Rectangle{
                    width:width-20 height:height-50
                    x:10 y:35
                    fill:Color.WHITE
                    effect:{
                        GaussianBlur { radius: 63  }
                        DropShadow{offsetX:0 offsetY:2 radius:10 color: Color.GRAY}
                    }
                  },
                 Text{
                     content: title
                     x: 15 y: 20
                     fill: Color.rgb(11,51,60)
                     font: Font{ size:14 name: "Verdana Bold"}
                 }
            ]
            
        }


    }

function run() {
    Stage {
       width: 400
       height: 380
        scene: Scene {
            content: [
                Panel {
                    width:    400
                    height:   380
                    title:    "Members Login"
                    translateX: 0
                    translateY: 0
                }
            ]
        }
    }
}



}
